package com.korion.main;

import com.instacart.library.truetime.TrueTime;

import java.io.IOException;
import java.util.Date;

public class Main {

    public static void main(String[] args) {
        System.out.println("True Time process...");
        try {
            TrueTime.build().initialize();
            System.out.println("Init success");
            while (true){
                Date local = new Date();
                Date trueTime = TrueTime.now();
                System.out.println("local: "+local.getTime() + ", trueTime: "+trueTime.getTime()+", diff:"+ (trueTime.getTime()-local.getTime()));
                Thread.sleep(0, 500);
            }
        } catch (IOException e) {
            System.out.println("init fail: "+e.getMessage());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
